import { Provide } from '@midwayjs/decorator';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { BaseService } from '../../../common/base.service';
import { RoomUseRecordsEntity } from '../entity/roomUseRecords';
import CommonResponse from '../../../common/common.response';

@Provide()
export class RoomUseRecordsService extends BaseService<RoomUseRecordsEntity> {
  @InjectEntityModel(RoomUseRecordsEntity)
  roomUseRecordsModel: Repository<RoomUseRecordsEntity>;

  getModel(): Repository<RoomUseRecordsEntity> {
    return this.roomUseRecordsModel;
  }

  async tableList() {
    const rut = await this.list();
    return CommonResponse.tableRutSucc(rut);
  }
}